package org.webdb.jdbc.impl;

import java.io.IOException;

import com.healthmarketscience.common.util.AppendableExt;
import com.healthmarketscience.sqlbuilder.SelectQuery;
import com.healthmarketscience.sqlbuilder.SqlContext;

public class JDBCSelectQuery extends SelectQuery {

    protected Integer _limit = null;

    public JDBCSelectQuery limit(int i) {
        _limit = i;
        return this;
    }

    @Override
    protected void appendTo(AppendableExt app, SqlContext newContext)
            throws IOException {
        super.appendTo(app, newContext);
        if (_limit != null)
            app.append(" LIMIT ").append(_limit.toString());
    }

}
